home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Beziers y otros splines / Infinity / Infinity.cs next >
Encoding:
Text File  |  2002-05-07  |  1.4 KB  |  42 lines

  1. //---------------------------------------
  2. // Infinity.cs ⌐ 2001 by Charles Petzold
  3. //---------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class Infinity: PrintableForm
  9. {
  10.      public new static void Main()
  11.      {
  12.           Application.Run(new Infinity());
  13.      }
  14.      public Infinity()
  15.      {
  16.           Text = "Signo infinito utilizando splines de BΘzier";
  17.      }
  18.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  19.      {
  20.           cx--;
  21.           cy--;
  22.  
  23.           Point[] apt = 
  24.           {
  25.                new Point(0,          cy / 2),     // Inicio
  26.                new Point(0,          0),          // Control
  27.                new Point(    cx / 3, 0),          // Control
  28.                new Point(    cx / 2, cy / 2),     // Fin/Inicio
  29.                new Point(2 * cx / 3, cy),         // Control
  30.                new Point(    cx,     cy),         // Control
  31.                new Point(    cx,     cy / 2),     // Fin/Inicio
  32.                new Point(    cx,     0),          // Control
  33.                new Point(2 * cx / 3, 0),          // Control
  34.                new Point(    cx / 2, cy / 2),     // Fin/Inicio
  35.                new Point(    cx / 3, cy),         // Control
  36.                new Point(0,          cy),         // Control
  37.                new Point(0,          cy / 2)      // Fin
  38.           };
  39.           grfx.DrawBeziers(new Pen(clr), apt);
  40.      }
  41. }
  42.